package com.cloud.config;

import com.cloud.interceptor.feign.CustomFeignInterceptor;
import feign.Logger;
import feign.Request;
import feign.RequestInterceptor;
import feign.auth.BasicAuthRequestInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.TimeUnit;

/**
 * @Author wenbo
 * @Date 2022/12/14 10:35
 *
 * 全局配置: 当使用@Configuration 会将配置作用所有的服务提供方
 * 局部配置: 1.通过配置类:如果只想针对某一个服务进行配置,就不要加 @Configuration
 *          2.通过配置文件yml
 *
 **/
@Configuration
public class FeignConfig {


    @Bean
    public Logger.Level feignLoggerLevel(){
        return Logger.Level.FULL;

    }
//    @Bean
//    public Request.Options options(){
//        return new Request.Options(5000, TimeUnit.MILLISECONDS,
//                10000,TimeUnit.MILLISECONDS,false);
//    }

//    @Bean
//    public RequestInterceptor basicAuthRequestInterceptor(){
//        return new CustomFeignInterceptor();
//    }
}
